// 变量设置

// 主题颜色
@bg-color: #b7d4a8;
// 蛇的颜色
@snake-color: #000;

// 清除默认样式
* {
  margin: 0;
  padding: 0;
  // 改变盒子模型计算方式
  box-sizing: border-box;
}

.allPage {
  font: bold 20px 'Courier';
  display: flex;
  align-items: center;
  height: 100vh;
  width: 100vw;
  transform: scale(0.5);
}

// 手机
.phone {

  width: 388px;
  height: 700px;
  padding: 10px;
  border: 5px solid #000;
  border-radius: 40px;
  margin: 0 auto;
  background-color: #333;
  box-shadow: 15px 15px 15px #aaa;

  .header {
    width: 90px;
    height: 10px;
    margin: 0 auto 10px;
    border-radius: 30px;
    border: 3px solid #000;
    background-color: #aaa;
  }

  .bottom {
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;

    .left {
      height: 140px;
      // border: 3px solid #000;
      display: flex;
      flex-direction: column;
      align-items: center;

      #btn_top {
        height: 40px;
        width: 40px;
        background-color: #000;
        border: 2px solid #aaa;
        border-radius: 5px 5px 0px 0px;
        box-shadow: 5px 5px 5px #444;
      }

      #btn_top:hover {
        background-color: #333;
        cursor: pointer;
      }

      #btn_top:active {
        background-color: #555;
      }

      .btn_center_box {
        display: flex;

        &>div {
          height: 40px;
          width: 40px;
          background-color: #000;
          border: 2px solid #aaa;
          box-shadow: 5px 5px 5px #444;
        }

        &>div:hover {
          background-color: #333;
          cursor: pointer;
        }

        &>div:active {
          background-color: #555;
        }

        #btn_left {
          border-radius: 5px 0px 0px 5px;
        }

        #btn_center {}

        #btn_right {
          border-radius: 0px 5px 5px 0px;
        }

        #btn_right:hover {
          background-color: #333;
          cursor: pointer;
        }

        #btn_right:active {
          background-color: #555;
        }

      }

      #btn_down {
        height: 40px;
        width: 40px;
        background-color: #000;
        border: 2px solid #aaa;
        box-shadow: 5px 5px 5px #444;
        border-radius: 0px 0px 5px 5px;
      }

      #btn_down:hover {
        background-color: #333;
        cursor: pointer;
      }

      #btn_down:active {
        background-color: #555;
      }
    }

    .right {
      width: 35%;
      height: 100px;
      // border: 3px solid #000;
      display: flex;
      justify-content: space-between;
      align-items: center;

      &>div {
        width: 40px;
        height: 40px;
        background-color: #000;
        border: 2px solid #aaa;
        border-radius: 100%;
        box-shadow: 3px 3px 3px #444;
      }

      &>div:hover {
        background-color: #333;
        cursor: pointer;
      }

      &>div:active {
        background-color: #555;
      }

      .leftCircle {
        margin-top: 40px;
      }

      .rightCircle {}
    }

    .bottom {
      width: 50%;
      margin: 30px auto 0;
      display: flex;
      justify-content: space-around;

      &>div {
        width: 60px;
        height: 18px;
        border: 2px solid #aaa;
        border-radius: 40px;
        background-color: #000;
        box-shadow: 3px 3px 3px #444;
      }

      &>div:hover {
        background-color: #333;
        cursor: pointer;
      }

      &>div:active {
        background-color: #555;
      }

      .bottom_left {}

      .bottom_right {}
    }
  }
}

// 主窗口
#main {
  width: 360px;
  height: 400px;
  margin: 0 auto;
  background-color: @bg-color;
  border: 5px solid #000;
  border-radius: 40px;

  // 弹性盒模型
  display: flex;
  // 主轴方向
  flex-flow: column;
  // 侧轴对齐方式
  align-items: center;
  // 主轴对齐方式
  justify-content: space-around;

  // 游戏窗口
  #stage {
    width: 304px;
    height: 304px;
    border: 2px solid #000;
    position: relative;

    #snake {
      &>div {
        width: 10px;
        height: 10px;
        background-color: @snake-color;
        border: 1px solid @bg-color;
        // 绝对定位
        position: absolute;
      }
    }

    // 设置食物
    #food {
      // 绝对定位
      position: absolute;
      width: 10px;
      height: 10px;
      left: 20px;
      top: 80px;
      border: 1px solid @bg-color;
      display: flex;
      flex-flow: row wrap;
      justify-content: space-between;
      align-content: space-between;

      &>div {
        width: 4px;
        height: 4px;
        background-color: @snake-color;
        transform: rotate(45deg);
      }
    }
  }

  // 记分牌
  #score-panel {
    width: 300px;
    display: flex;
    // 主轴对齐方法
    justify-content: space-between;
  }
}